<?php
	if(isset($_REQUEST['id']))
	{
		include_once('DonHangDTO.php');
		include_once('DonHangDAO.php');
		include_once('DataHelper.php');
		$id=$_REQUEST['id'];
		$KQ = DonHangDao::XoaDonHangTheoMaDonHang($id);
		$result = DonHangDAO::DanhSachDonHang();
		for($i = 0 ; $i < count($result) ; $i++)
		{
			$row = $result[$i];
			echo("
			<tr>
			<td> $row->dh_ma</td>
			<td>$row->dh_username</td>
			<td> $row->dh_ngay_dat</td>
			<td>$row->dh_ngay_giao</td>
			<td>$row->dh_tong_tien</td>
			<td>");
				if($row->dh_tinh_trang ==0)
				{
					echo 'Dang cho duyet';
				}
				if($row->dh_tinh_trang ==1)
				{
					echo 'Da duyet';
				}
				echo("</td>
			<td><input type='button' value='Huy' onClick='Huy($row->dh_ma);' width='20px' /></td>
			<td><input type='button' value='Cap nhat' onClick='CapNhat($row->dh_ma);' width='20px' /></td>
								<td><a  href='ChiTietDonHang.php?id=$row->dh_ma&Ten=$row->dh_username'>Chi Tiet</a></td>
			</tr>");

		}
	}
?>